package com.ifox.hgx.spring.factory;

import com.ifox.hgx.spring.bean.Car;

import java.util.HashMap;
import java.util.Map;

/**
 * Copyright (C), 2017-2018, 成都艾弗克斯科技有限公司
 * Author:   hanguixian
 * Date:     2018/10/21 11:03
 * Description:
 */
public class CarStaticFactory {
    private static Map<Integer, Car> cars = new HashMap<>();

    static {
        cars.put(1, new Car(1, "大奔"));
        cars.put(2, new Car(2, "劳斯莱斯"));
    }


    public static Car getCar(Integer id) {
        return cars.get(2);
    }
}
